package cn.wolfcode.wolf2w.repostiory;


import cn.wolfcode.wolf2w.domain.Strategy;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * 攻略持久层接口
 */
@Repository
public interface StrategyRepository extends MongoRepository<Strategy, String>{
    /**
     * 通过攻略的分类id查询攻略
     * @param id
     * @return
     */

    List<Strategy> findByCatalogId(String id);

    /**
     * 通过冗余字段destId查询我们的攻略
     * @param destId
     * @param pageable
     * @return
     */
    List<Strategy> findByDestId(String destId, Pageable pageable);

    /**
     * 目的地名查攻略
     * @param keyword
     * @return
     */
    List<Strategy> queryByDestName(String keyword);
}
